{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Episode 5: Intro to dialogue management with Rasa\n",
    "\n",
    "In this episode we are looking into the Dialogue management with Rasa - understanding the structure of training data (stories) and creating new examples.\n",
    "\n",
    "Dialogue management training data (stories) correspond to actual conversations between the user and an assistant where user inputs are expressed as corresponding intents while the responses of the assistant are expressed as corresponding actions.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this episode we created some training stories for the medicare locator assistant. Run the cell below to update the stories in your stories.md file. You are encouraged to write more stories with different dialogue turns."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing 'stories_md' (str) to file 'data/stories.md'.\n"
     ]
    }
   ],
   "source": [
    "stories_md = \"\"\"\n",
    "\n",
    "## hospital search happy path\n",
    "* greet\n",
    "  - utter_how_can_i_help\n",
    "* search_provider{\"facility_type\":\"hospital\", \"location\": \"San Francisco\"}\n",
    "  - action_facility_search\n",
    "* thanks\n",
    "  - utter_goodbye\n",
    "\n",
    "## hospital search + location\n",
    "* greet\n",
    "  - utter_how_can_i_help\n",
    "* search_provider{\"facility_type\":\"hospital\"}\n",
    "  - utter_ask_location\n",
    "* inform{\"location\":\"San Francisco\"}\n",
    "  - action_facility_search\n",
    "* thanks\n",
    "  - utter_goodbye\n",
    "\n",
    "## happy path\n",
    "* greet\n",
    "  - utter_greet\n",
    "* mood_great\n",
    "  - utter_happy\n",
    "\n",
    "## sad path 1\n",
    "* greet\n",
    "  - utter_greet\n",
    "* mood_unhappy\n",
    "  - utter_cheer_up\n",
    "  - utter_did_that_help\n",
    "* affirm\n",
    "  - utter_happy\n",
    "\n",
    "## sad path 2\n",
    "* greet\n",
    "  - utter_greet\n",
    "* mood_unhappy\n",
    "  - utter_cheer_up\n",
    "  - utter_did_that_help\n",
    "* deny\n",
    "  - utter_goodbye\n",
    "\n",
    "## say goodbye\n",
    "* goodbye\n",
    "  - utter_goodbye\n",
    "\n",
    "\"\"\"\n",
    "%store stories_md > data/stories.md"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
